package jumpingnotes.model.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import net.jf.lucene.analysis.mmseg.MMSegAnalyzer;

import org.hibernate.search.annotations.Analyzer;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;

@Entity
@Table(name = "error_report", catalog = "jumping_notes")
@Indexed
@Analyzer(impl = MMSegAnalyzer.class)
public class ErrorReport implements java.io.Serializable
{

	private Integer errorReportId;
	private int memberId;
	private int type;
	private Integer targetId;
	private String subject;
	private String body;
	private Integer status;
	private Date createTime;

	public ErrorReport()
	{
	}

	public ErrorReport(int memberId, int type, Date createTime)
	{
		this.memberId = memberId;
		this.type = type;
		this.createTime = createTime;
	}

	public ErrorReport(int memberId, int type, Integer targetId, String subject, String body, Integer status,
			Date createTime)
	{
		this.memberId = memberId;
		this.type = type;
		this.targetId = targetId;
		this.subject = subject;
		this.body = body;
		this.status = status;
		this.createTime = createTime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "error_report_id", unique = true, nullable = false)
	@DocumentId
	public Integer getErrorReportId()
	{
		return this.errorReportId;
	}

	public void setErrorReportId(Integer errorReportId)
	{
		this.errorReportId = errorReportId;
	}

	@Column(name = "member_id", nullable = false)
	public int getMemberId()
	{
		return this.memberId;
	}

	public void setMemberId(int memberId)
	{
		this.memberId = memberId;
	}

	@Column(name = "type", nullable = false)
	public int getType()
	{
		return this.type;
	}

	public void setType(int type)
	{
		this.type = type;
	}

	@Column(name = "target_id")
	public Integer getTargetId()
	{
		return this.targetId;
	}

	public void setTargetId(Integer targetId)
	{
		this.targetId = targetId;
	}

	@Column(name = "subject", length = 100)
	@Field(index = Index.TOKENIZED, store = Store.NO)
	public String getSubject()
	{
		return this.subject;
	}

	public void setSubject(String subject)
	{
		this.subject = subject;
	}

	@Column(name = "body", length = 65535)
	@Field(index = Index.TOKENIZED, store = Store.NO)
	public String getBody()
	{
		return this.body;
	}

	public void setBody(String body)
	{
		this.body = body;
	}

	@Column(name = "status")
	public Integer getStatus()
	{
		return this.status;
	}

	public void setStatus(Integer status)
	{
		this.status = status;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", nullable = false, length = 19)
	public Date getCreateTime()
	{
		return this.createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

}
